package cn.lzx.feign;

import cn.lzx.pojo.StorePojo;
import cn.lzx.utils.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public JsonResult add(StorePojo storePojo) {
                return new JsonResult(false,"服务器繁忙");
            }
        };
    }
}
